﻿/*
 * Created by SharpDevelop.
 * User: Michael
 * Date: 24/12/2014
 * Time: 10:45 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using AdvGenContact.Data;
using AdvGenContact.Data.Serialization;
using AdvGenContatct.Views;

namespace AdvGenContact.App.WPF
{
	/// <summary>
	/// Description of MainWindowApp.
	/// </summary>
	public class MainApp : BaseApp , IMainApp
	{
		private string fileName;
		public IMainWindowView  View {get;set;}
		public void OpenFile(string fileName)
		{
			this.fileName = fileName;
			GobalData.Open(fileName);
			
		}

	public void SaveFile()
	{
		GobalData.SaveAs(fileName);
	}

	
	public void NewFile()
	{
		Saved = true;
		this.Groups = new List<IGroup>();
		this.People = new List<IPerson>();
		GobalData.NewData();
		
	}
	public void SaveAsFile(string fileName)
	{
		Saved = true;
		GobalData.SaveAs(fileName);
			
	}

	public System.Collections.Generic.IList<IGroup> Groups {
		get;
		set ;
	}

	public System.Collections.Generic.IList<IPerson> People {
		get;
		set ;
	}

	public bool Saved {
		get;
		set;
	}

		
		
		public override void Onload()
		{
			
		}
		public 	void AddPerson ()
		{
			Saved = false;
		}
		public void AddGroup(){
				Saved = false;
		}
		public void ListPeople (){
				
		}
		public void ListGroups ()
		{
			
		}
		
		

	}
}
